import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { ScheduleModule } from 'nest-schedule';
import { AuthModule } from './modules/userAuth/auth.module';
import { PostModule } from './modules/adminPost/post.module';
import { UploadModule } from './modules/fileUpload/upload.module';
import { AppWebModule } from './modules/appPost/app.module';

@Module({
  imports: [
    TypeOrmModule.forRoot({
      type: 'mysql',
      host: '120.79.186.13',
      port: 3306,
      username: 'root',
      password: 'suhao@DB1993',
      database: 'okr',
      charset: 'utf8mb4', // 设置chatset编码为utf8mb4
      autoLoadEntities: true,
      synchronize: true,
    }),
    AuthModule,
    PostModule,
    UploadModule,
    AppWebModule,
    ScheduleModule.register(),
  ],
})
export class AppModule {}
